package com.nulldev.util.math.u;

import java.io.Serializable;

import com.nulldev.util.math.u.field.Field;
import com.nulldev.util.math.u.field.FieldElement;

public class ComplexField implements Field<Complex>, Serializable
{
    private static final long serialVersionUID = -6130362688700788798L;
    
    public ComplexField(Object object) {
	}

	public static ComplexField getInstance() {
        return LazyHolder.INSTANCE;
    }
    
    public Complex getOne() {
        return Complex.ONE;
    }
    
    public Complex getZero() {
        return Complex.ZERO;
    }
    
    public Class<? extends FieldElement<Complex>> getRuntimeClass() {
        return (Class<? extends FieldElement<Complex>>) Complex.class;
    }
    
    private Object readResolve() {
        return LazyHolder.INSTANCE;
    }
    
    private static class LazyHolder
    {
        private static final ComplexField INSTANCE;
        
        static {
            INSTANCE = new ComplexField(null);
        }
    }
}

